The process of editing electronic documents generally consists of processing events and key combinations received by an editor. From events and key combinations, an editing space is created. The editing space consists of a document state plus a view state (visual feedback). The view state includes a selection state (what is selected, what is shown as feedback), scroll position, etc. The event interacts with the current state, and an editing model is applied to manipulate feedback or to manipulate the document based on the feedback.
Extensible editors typically provide a set of document manipulation services that can enable macros to perform advanced tasks on the content of a document. With an extensible editor, developers can couple extensions that define or re-define a manner in which the editor responds to events or key combinations and provides visual feedback to a user. For example, if a developer wishes to create a new look to a selection process or a highlighting process in an extensible editor, the developer can create an extension that receives input regarding cursor position, cursor movement, mouse actions, etc. The developer can design the extension to use this input to create visual feedback that differs from a default selection service or highlight service of the editor. However, familiar behavior of the editor (such as clicking a “bold” button) is still retained by the editor. In addition, an extension can also expose virtually any kind of functionality through its own interfaces.
Extensible editors are designed so that one or more extensions can be coupled with the editor. This is accomplished by implementing a set of interfaces to which the extensions must conform. The interfaces are utilized by the extensions to access a host of basic functions so that the extensions themselves are not required to implement such basic functions. The extensions instead utilize the basic functions to perform tasks that supplement or override functions performed by the editor.
Extensible editors are desirable for their ability to include customer extensions to provide a rich editing experience. A significant part of an editing experience involves the highlight rendering model provided by the editor. A user may wish to develop a custom extension that includes a highlight rendering process that provides a unique look and feel to visual feedback that a user sees during an editing session, but that does not actually change the content that is being edited.
When utilizing extensions in an extensible editor, however, a conflict problem can arise if multiple extensions are used simultaneously that act upon the occurrence of the same event or key combination. If a first extension reacts to an event in one way, but a second extension receives the event after the first extension has acted on it, the second extension may also act on the event and, as a result, override the action of the first extension. This problem can occur even when using only one extension, if the extension acts on an event or key combination but does not prevent the (default) editor from subsequently acting on the same event.